<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Hexo博客多媒体的多种操作 | XiaoZiYan</title><meta name="keywords" content="Typora,图片,视频,图床,gitee,Picgo,嵌入视频"><meta name="author" content="XiaoZiYan"><meta name="copyright" content="XiaoZiYan"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="图片视频图床视频Hexo博客的使用">
<meta property="og:type" content="article">
<meta property="og:title" content="Hexo博客多媒体的多种操作">
<meta property="og:url" content="https://xiaoziyanxiaoludan.gitee.io/xiaoziyan/2019/09/22/%E6%98%BE%E7%A4%BA%E6%9C%AC%E5%9C%B0%E5%9B%BE%E7%89%87/index.html">
<meta property="og:site_name" content="XiaoZiYan">
<meta property="og:description" content="图片视频图床视频Hexo博客的使用">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://xiaoziyan.top/images/10e9f75e8812959f68c1a279dcd70da8.jpeg">
<meta property="article:published_time" content="2019-09-22T15:28:02.000Z">
<meta property="article:modified_time" content="2022-11-03T10:28:04.736Z">
<meta property="article:author" content="XiaoZiYan">
<meta property="article:tag" content="Typora">
<meta property="article:tag" content="图片">
<meta property="article:tag" content="视频">
<meta property="article:tag" content="图床">
<meta property="article:tag" content="gitee">
<meta property="article:tag" content="Picgo">
<meta property="article:tag" content="嵌入视频">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://xiaoziyan.top/images/10e9f75e8812959f68c1a279dcd70da8.jpeg"><link rel="shortcut icon" href="/xiaoziyan/img/favicon.png"><link rel="canonical" href="https://xiaoziyanxiaoludan.gitee.io/xiaoziyan/2019/09/22/%E6%98%BE%E7%A4%BA%E6%9C%AC%E5%9C%B0%E5%9B%BE%E7%89%87/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta/><link rel="stylesheet" href="/xiaoziyan/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/xiaoziyan/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":50,"languages":{"author":"作者: XiaoZiYan","link":"链接: ","source":"来源: XiaoZiYan","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"bottom-left"},
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isanchor: true
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Hexo博客多媒体的多种操作',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-11-03 18:28:04'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="./css/custom.css" media="defer" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"><!-- hexo injector head_end start --><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Zfour/hexo-electric-clock@1.0.6/clock.css"><!-- hexo injector head_end end --><meta name="generator" content="Hexo 5.4.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/xiaoziyan/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/xiaoziyan/archives/"><div class="headline">文章</div><div class="length-num">33</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/xiaoziyan/tags/"><div class="headline">标签</div><div class="length-num">41</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/xiaoziyan/categories/"><div class="headline">分类</div><div class="length-num">39</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/xiaoziyan/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/xiaoziyan/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/xiaoziyan/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/xiaoziyan/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 多媒体</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/xiaoziyan/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/xiaoziyan/movies/"><i class="fa-fw fas fa-video"></i><span> 视频</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/xiaoziyan/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/xiaoziyan/about/"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('http://xiaoziyan.top/images/10e9f75e8812959f68c1a279dcd70da8.jpeg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/xiaoziyan/">XiaoZiYan</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/xiaoziyan/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/xiaoziyan/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/xiaoziyan/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/xiaoziyan/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 多媒体</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/xiaoziyan/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/xiaoziyan/movies/"><i class="fa-fw fas fa-video"></i><span> 视频</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/xiaoziyan/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/xiaoziyan/about/"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Hexo博客多媒体的多种操作</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2019-09-22T15:28:02.000Z" title="发表于 2019-09-22 23:28:02">2019-09-22</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-11-03T10:28:04.736Z" title="更新于 2022-11-03 18:28:04">2022-11-03</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/xiaoziyan/categories/%E5%9B%BE%E7%89%87/">图片</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/xiaoziyan/categories/%E5%9B%BE%E7%89%87/%E8%A7%86%E9%A2%91/">视频</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/xiaoziyan/categories/%E5%9B%BE%E7%89%87/%E8%A7%86%E9%A2%91/%E5%9B%BE%E5%BA%8A/">图床</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/xiaoziyan/categories/%E5%9B%BE%E7%89%87/%E8%A7%86%E9%A2%91/%E5%9B%BE%E5%BA%8A/%E8%A7%86%E9%A2%91/">视频</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/xiaoziyan/categories/%E5%9B%BE%E7%89%87/%E8%A7%86%E9%A2%91/%E5%9B%BE%E5%BA%8A/%E8%A7%86%E9%A2%91/Hexo%E5%8D%9A%E5%AE%A2%E7%9A%84%E4%BD%BF%E7%94%A8/">Hexo博客的使用</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Hexo博客多媒体的多种操作"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="显示本地图片"><a href="#显示本地图片" class="headerlink" title="显示本地图片"></a>显示本地图片</h2><p>如果你的博客也是通过<code>Hexo</code>框架建立的，在使用初期你可能也遇到过和我相似的问题：在一个<code>.md</code>文件中添加的图片，在Typora编辑器里面可以预览，但是程序一跑起来就显示不出来。</p>
<p><img src="http://xiaoziyan.top/images/image-20211005225937358.png" alt="Typora编辑器中可以显示"></p>
<p>运行起来后不显示。</p>
<p><img src="http://xiaoziyan.top/images/image-20211005230109779.png" alt="在网页上预览"></p>
<p>下面分享一种解决此问题的方法：</p>
<ol>
<li>修改博客配置。</li>
<li>下载插件。</li>
</ol>
<h3 id="修改博客配置"><a href="#修改博客配置" class="headerlink" title="修改博客配置"></a>修改博客配置</h3><p>修改博客根目录中<code>_config.yml</code>文件的配置项<code>post_asset_folder</code>为<code>true</code>：</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">post_asset_folder: true</span><br></pre></td></tr></table></figure>

<p><img src="http://xiaoziyan.top/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202021-10-05%20223109.jpg" alt="post_asset_folder"></p>
<p>完成此设置后，当你通过<code>hexo new 文件名</code>新建博客后，会产生一个和文件同名的文件夹。</p>
<p><img src="http://xiaoziyan.top/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202021-10-05%20222949.jpg" alt="与md文件同名文件夹"></p>
<h3 id="下载插件"><a href="#下载插件" class="headerlink" title="下载插件"></a>下载插件</h3><p>在博客根目录中下使用npm安装插件：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install https://github.com/CodeFalling/hexo-asset-image --save</span><br></pre></td></tr></table></figure>

<h3 id="示例"><a href="#示例" class="headerlink" title="示例"></a>示例</h3><p>当文章需要添加图片时，将需要添加的图片放入同名的文件夹中，同时通过相对路径索引到该图片。</p>
<p>例如我在上方修改博客配置中展示的那张图片的md源码为：</p>
<p><img src="http://xiaoziyan.top/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202021-10-05%20223421.jpg" alt="随便选一张"></p>
<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">![<span class="string">示例</span>](<span class="link">a.jpg</span>)</span><br></pre></td></tr></table></figure>

<p>使用命令<code>hexo s</code>开启服务，若无报错在本地可以看到图片在博客中正确显示。</p>
<p><img src="a.jpg" alt="示例"></p>
<h2 id="利用图床显示图片"><a href="#利用图床显示图片" class="headerlink" title="利用图床显示图片"></a>利用图床显示图片</h2><h3 id="Picgo-Gitee实现自己的图床"><a href="#Picgo-Gitee实现自己的图床" class="headerlink" title="Picgo+Gitee实现自己的图床"></a>Picgo+Gitee实现自己的图床</h3><h4 id="图床是干什么的？"><a href="#图床是干什么的？" class="headerlink" title="图床是干什么的？"></a>图床是干什么的？</h4><p>图床就是一个便于在博文中插入在线图片连接的个人图片仓库。设置图床之后，在自己博客中插入的图片链接就可以随时随地在线预览了，并且不会因为任何意外原因无法查看，除非自己亲自删除。</p>
<p>这里给大家推荐一个图床工具PicGo，它可以将图片上传到指定的图床上，然后返回你需要的各种格式的链接，直接粘贴到你的文档中就可以了。</p>
<p>我最终使用的图床工具Picgo和图片存储Gitee来实现图床。</p>
<h3 id="PicGo"><a href="#PicGo" class="headerlink" title="PicGo"></a>PicGo</h3><p>picgo-plugin-gitee-uploader插件</p>
<p>安装<br>官网：<a target="_blank" rel="noopener" href="https://github.com/Molunerfinn/PicGo">https://github.com/Molunerfinn/PicGo</a></p>
<p>下载安装后打开</p>
<p><img src="http://xiaoziyan.top/images/image-20211005231803121.png" alt="Picgo主页"></p>
<h4 id="选择插件设置"><a href="#选择插件设置" class="headerlink" title="选择插件设置"></a>选择插件设置</h4><p>搜索gitee</p>
<p>点击右边的gitee-uploader 1.1.2开始安装</p>
<h2 id="建立Gitee图床库"><a href="#建立Gitee图床库" class="headerlink" title="建立Gitee图床库"></a>建立Gitee图床库</h2><p>有账号的应该都会用，没有账号的自己注册一下，很简单，就像注册QQ。</p>
<h4 id="新建仓库"><a href="#新建仓库" class="headerlink" title="新建仓库"></a>新建仓库</h4><p><img src="http://xiaoziyan.top/images/10122332-998bea4a84e3c9b0.webp" alt="建一个仓库"></p>
<p><strong>新建仓库要点：</strong></p>
<ol>
<li>输入一个仓库名称（自定义）</li>
<li>其次将仓库设为公开</li>
<li>勾选使用Readme文件初始化这个仓库</li>
</ol>
<p><img src="http://xiaoziyan.top/images/10122332-a7aa2cf408e9b8b6.webp" alt="配置仓库"></p>
<p>按照图片选择，不会有问题的。</p>
<h2 id="配置PicGo"><a href="#配置PicGo" class="headerlink" title="配置PicGo"></a>配置PicGo</h2><p>安装了gitee-uploader 1.1.2插件之后，我们开始配置插件，安装完插件后最好重启一下。</p>
<p><img src="http://xiaoziyan.top/images/image-20211005233654386.png" alt="安装插件"></p>
<p><strong>配置要点如下：</strong></p>
<p><img src="http://xiaoziyan.top/images/image-20211005233800605.png" alt="配置gitee"></p>
<ul>
<li><p>repo：gitee用户名/仓库名称</p>
</li>
<li><p>branch：分支，填写master</p>
</li>
<li><p>token：填入私人令牌</p>
<ol>
<li><p>点击头像，进入设置</p>
<p><img src="http://xiaoziyan.top/images/10122332-998bea4a84e3c9b0.webp" alt="新建仓库"></p>
</li>
<li><p>找到右边安全设置里面的私人令牌</p>
<p><img src="http://xiaoziyan.top/images/10122332-7368bc7c66d9fac1.webp" alt="设置私人令牌"></p>
</li>
<li><p>点击生成新令牌，把projects这一项勾上，其他的不用勾，然后提交</p>
<p><img src="http://xiaoziyan.top/images/10122332-4dc336a0660e277c.webp" alt="生成令牌"></p>
</li>
<li><p>点击提交后需要验证一下密码，验证完成后会显示你的token，复制它,粘贴到token</p>
<p><img src="http://xiaoziyan.top/images/10122332-c0faa905b99139d3.webp" alt="复制令牌"></p>
</li>
</ol>
</li>
</ul>
<h4 id="保存设置，并设置为默认图床"><a href="#保存设置，并设置为默认图床" class="headerlink" title="保存设置，并设置为默认图床"></a>保存设置，并设置为默认图床</h4><h3 id="Typora编辑器设置"><a href="#Typora编辑器设置" class="headerlink" title="Typora编辑器设置"></a>Typora编辑器设置</h3><h4 id="设置→图像"><a href="#设置→图像" class="headerlink" title="设置→图像"></a>设置→图像</h4><p><img src="http://xiaoziyan.top/images/image-20211005232539622.png" alt="图像设置"></p>
<h4 id="图像上传配置"><a href="#图像上传配置" class="headerlink" title="图像上传配置"></a>图像上传配置</h4><p>按照步骤依次设置好Picgo的路径，最后验证一下是否可以。</p>
<p><img src="http://xiaoziyan.top/images/image-20211005232816315.png" alt="配置图像"></p>
<p>验证成功后就可以直接复制粘贴图片在markdown编辑器点击上传或者设置自动上传就可以啦，大大方便了使用效率。</p>
<h2 id="播放B站视频"><a href="#播放B站视频" class="headerlink" title="播放B站视频"></a>播放B站视频</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">复制 嵌入代码 到文章，可通过width、height修改播放窗口尺寸</span><br></pre></td></tr></table></figure>

<p><img src="http://xiaoziyan.top/images/image-20211005230738660.png" alt="通过分享获取嵌入代码"></p>
<div align=center class="aspect-ratio">
    <iframe src="//player.bilibili.com/player.html?aid=753913154&bvid=BV1vk4y1B7Fx&cid=215138210&page=1&high_quality=1"
    height="600px"
    width="800px"
    scrolling="no" 
    border="0" 
    frameborder="no" 
    framespacing="0" 
    high_quality=1
    danmaku=1 
    allowfullscreen="true"> 
    </iframe>
</div>




</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">XiaoZiYan</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a target="_blank" rel="noopener" href="https://baidu.com">https://baidu.com</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://xiaoziyanxiaoludan.gitee.io/xiaoziyan" target="_blank">XiaoZiYan</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/xiaoziyan/tags/Typora/">Typora</a><a class="post-meta__tags" href="/xiaoziyan/tags/%E5%9B%BE%E7%89%87/">图片</a><a class="post-meta__tags" href="/xiaoziyan/tags/%E8%A7%86%E9%A2%91/">视频</a><a class="post-meta__tags" href="/xiaoziyan/tags/%E5%9B%BE%E5%BA%8A/">图床</a><a class="post-meta__tags" href="/xiaoziyan/tags/gitee/">gitee</a><a class="post-meta__tags" href="/xiaoziyan/tags/Picgo/">Picgo</a><a class="post-meta__tags" href="/xiaoziyan/tags/%E5%B5%8C%E5%85%A5%E8%A7%86%E9%A2%91/">嵌入视频</a></div><div class="post_share"><div class="social-share" data-image="http://xiaoziyan.top/images/10e9f75e8812959f68c1a279dcd70da8.jpeg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/xiaoziyan/2019/10/06/C51%E5%8D%95%E7%89%87%E6%9C%BA%E5%AD%A6%E4%B9%A0%E2%80%94%E2%80%94%E6%B5%81%E6%B0%B4%E7%81%AF/"><img class="prev-cover" src="http://xiaoziyan.top/images/adb7f9eca04e6f962fe5f3e4a54d1d12.jpeg" onerror="onerror=null;src='/xiaoziyan/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">C51单片机学习——流水灯</div></div></a></div><div class="next-post pull-right"><a href="/xiaoziyan/2019/08/19/Markdown%E7%9A%84%E6%97%A5%E5%B8%B8%E4%BD%BF%E7%94%A8/"><img class="next-cover" src="http://xiaoziyan.top/images/5252742a7687ed181ad65716890688f5.jpeg" onerror="onerror=null;src='/xiaoziyan/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Markdown的日常使用语法</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/xiaoziyan/2019/08/19/Markdown%E7%9A%84%E6%97%A5%E5%B8%B8%E4%BD%BF%E7%94%A8/" title="Markdown的日常使用语法"><img class="cover" src="http://xiaoziyan.top/images/5252742a7687ed181ad65716890688f5.jpeg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-08-19</div><div class="title">Markdown的日常使用语法</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%98%BE%E7%A4%BA%E6%9C%AC%E5%9C%B0%E5%9B%BE%E7%89%87"><span class="toc-number">1.</span> <span class="toc-text">显示本地图片</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%8D%9A%E5%AE%A2%E9%85%8D%E7%BD%AE"><span class="toc-number">1.1.</span> <span class="toc-text">修改博客配置</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%8B%E8%BD%BD%E6%8F%92%E4%BB%B6"><span class="toc-number">1.2.</span> <span class="toc-text">下载插件</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%A4%BA%E4%BE%8B"><span class="toc-number">1.3.</span> <span class="toc-text">示例</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%88%A9%E7%94%A8%E5%9B%BE%E5%BA%8A%E6%98%BE%E7%A4%BA%E5%9B%BE%E7%89%87"><span class="toc-number">2.</span> <span class="toc-text">利用图床显示图片</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Picgo-Gitee%E5%AE%9E%E7%8E%B0%E8%87%AA%E5%B7%B1%E7%9A%84%E5%9B%BE%E5%BA%8A"><span class="toc-number">2.1.</span> <span class="toc-text">Picgo+Gitee实现自己的图床</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%9B%BE%E5%BA%8A%E6%98%AF%E5%B9%B2%E4%BB%80%E4%B9%88%E7%9A%84%EF%BC%9F"><span class="toc-number">2.1.1.</span> <span class="toc-text">图床是干什么的？</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#PicGo"><span class="toc-number">2.2.</span> <span class="toc-text">PicGo</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%80%89%E6%8B%A9%E6%8F%92%E4%BB%B6%E8%AE%BE%E7%BD%AE"><span class="toc-number">2.2.1.</span> <span class="toc-text">选择插件设置</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%BB%BA%E7%AB%8BGitee%E5%9B%BE%E5%BA%8A%E5%BA%93"><span class="toc-number">3.</span> <span class="toc-text">建立Gitee图床库</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%96%B0%E5%BB%BA%E4%BB%93%E5%BA%93"><span class="toc-number">3.0.1.</span> <span class="toc-text">新建仓库</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%85%8D%E7%BD%AEPicGo"><span class="toc-number">4.</span> <span class="toc-text">配置PicGo</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BF%9D%E5%AD%98%E8%AE%BE%E7%BD%AE%EF%BC%8C%E5%B9%B6%E8%AE%BE%E7%BD%AE%E4%B8%BA%E9%BB%98%E8%AE%A4%E5%9B%BE%E5%BA%8A"><span class="toc-number">4.0.1.</span> <span class="toc-text">保存设置，并设置为默认图床</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Typora%E7%BC%96%E8%BE%91%E5%99%A8%E8%AE%BE%E7%BD%AE"><span class="toc-number">4.1.</span> <span class="toc-text">Typora编辑器设置</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%AE%BE%E7%BD%AE%E2%86%92%E5%9B%BE%E5%83%8F"><span class="toc-number">4.1.1.</span> <span class="toc-text">设置→图像</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%9B%BE%E5%83%8F%E4%B8%8A%E4%BC%A0%E9%85%8D%E7%BD%AE"><span class="toc-number">4.1.2.</span> <span class="toc-text">图像上传配置</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%92%AD%E6%94%BEB%E7%AB%99%E8%A7%86%E9%A2%91"><span class="toc-number">5.</span> <span class="toc-text">播放B站视频</span></a></li></ol></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By XiaoZiYan</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><p><a style="margin-inline:5px"target="_blank" href="https://hexo.io/"> <img src="https://img.shields.io/badge/Frame-Hexo-blue?style=flat&logo=hexo" title="博客框架为 Hexo" alt="HEXO"></a><a style="margin-inline:5px"target="_blank"href="https://butterfly.js.org/"> <img src="https://img.shields.io/badge/Theme-Butterfly-6513df?style=flat&logo=bitdefender" title="主题采用 Butterfly" alt="Butterfly"></a><a style="margin-inline:5px"target="_blank" href="https://www.jsdelivr.com/"> <img src="https://img.shields.io/badge/CDN-jsDelivr-orange?style=flat&logo=jsDelivr" title="本站使用 Jsdelivr 为静态资源提供CDN加速" alt="Jsdelivr"></a><a style="margin-inline:5px"target="_blank" href="https://github.com/"> <img src="https://img.shields.io/badge/Source-gitee-d021d6?style=flat&logo=Gitee" title="本站项目由 Gitee 托管" alt="Gitee"></a><a style="margin-inline:5px"target="_blank"href="http://creativecommons.org/licenses/by-nc-sa/4.0/"> <img src="https://img.shields.io/badge/Copyright-BY--NC--SA%204.0-d42328?style=flat&logo=Claris" alt="img" title="本站采用知识共享署名-非商业性使用-相同方式共享4.0国际许可协议进行许可"></a></p></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/xiaoziyan/js/utils.js"></script><script src="/xiaoziyan/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"></div><script src="./js/sakura.js"></script><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/fireworks.min.js"></script><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-ribbon.min.js" size="150" alpha="0.6" zIndex="-1" mobile="false" data-click="true"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start --><script data-pjax>function electric_clock_injector_config(){
                var parent_div_git = document.getElementsByClassName('sticky_layout')[0];
                var item_html = '<div class="card-widget card-clock"><div class="card-glass"><div class="card-background"><div class="card-content"><div id="hexo_electric_clock"><img id="card-clock-loading" src="https://cdn.jsdelivr.net/gh/Zfour/Butterfly-clock/clock/images/weather/loading.gif" style="height: 120px; width: 100%;" data-ll-status="loading" class="entered loading"></div></div></div></div></div>';
                console.log('已挂载electric_clock')
                // parent_div_git.innerHTML=item_html+parent_div_git.innerHTML // 无报错，但不影响使用(支持pjax跳转)
                parent_div_git.insertAdjacentHTML("afterbegin",item_html) // 有报错，但不影响使用(支持pjax跳转)
            }if( document.getElementsByClassName('sticky_layout')[0] && (location.pathname ==='all'|| 'all' ==='all')){

            electric_clock_injector_config()
        } </script><script src="https://pv.sohu.com/cityjson?ie=utf-8"></script><script data-pjax  src="https://cdn.jsdelivr.net/gh/Zfour/hexo-electric-clock@1.0.6/clock.js"></script><!-- hexo injector body_end end --></body></html>